package com.chenziwen.scala.chapter08

object Scala13_ScanFunction {
  def main(args: Array[String]): Unit = {
    def minus(num1: Int, num2: Int): Int = {
      num1 - num2
    }
    // 扫描，会把产生的所有中间结果放置于一个集合中保存
    val ints = (1 to 5).scanLeft(0)(minus)
    println(ints)
  }
}
